package com.cfuture08.home.action.columns;

import com.cfuture08.eweb4j.component.dwz.DWZUtil;
import com.cfuture08.eweb4j.mvc.action.ActionSupport;
import com.cfuture08.eweb4j.orm.dao.DAO;
import com.cfuture08.home.vo.Columns;

public class DeleteColumns extends ActionSupport {
	private String ids;

	public String execute() {
		String[] idArray = ids.split(",");
		Columns[] cols = new Columns[idArray.length];
		for (int i = 0; i < cols.length; ++i) {
			cols[i] = new Columns();
			cols[i].setId(Integer.parseInt(idArray[i]));
		}

		out.print(DAO.delete(cols) == true ? DWZUtil.getSuccessJson("删除栏目成功",
				"xssylm", "showAllColumns.do", "reloadTab") : DWZUtil
				.getFailedJson("删除栏目失败"));

		return AJAX;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}
}
